﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="companyScoreList.aspx.cs"
    Inherits="PeisongWeb.admin.companyScoreList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>企业考核 - 想购网长期采购物流配送系统</title>
    <!--#include file="style.inc"-->

    <script type="text/javascript">
        function resetSrh() {
            document.getElementById("txt_companyName").value = "";
            document.getElementById("ddl_Type").value = "";
            document.getElementById("txt_mobile").value = "";
        }
        function OperateConfirm() {
            var operate=document.getElementById('ddlOperate');
            var score = document.getElementById('txtScore');

            if (score.value.length == 0 || document.getElementById('txtReason').value.length == 0) {
                alert('输入信息不完整，请填写完整。');
                return false;
            }
            if (! /^\+?[1-9][0-9]*$/.test(score.value)) {
                alert('评分格式输入不正确，请输入一个正整数.');
                score.focus();
                return false;
            }

            return confirm('您确定为该企业' + (operate.options[operate.selectedIndex].value == '0' ? '减' : '加') + score.value + '分?');
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            企业考核</h2>
        <p>&nbsp;</p>
        <ext:Panel ID="Panel1" runat="server" Title="企业搜索" BodyStyle="padding:5px 5px 0"
            Width="960" Frame="true" ButtonAlign="Center">
            <Body>
                <ext:Panel ID="Panel5" runat="server">
                    <Body>
                        <ext:ColumnLayout ID="ColumnLayout2" runat="server">
                            <ext:LayoutColumn ColumnWidth=".5">
                                <ext:Panel ID="Panel6" runat="server" Border="false" Header="false">
                                    <Body>
                                        <div id="admin_edit_content_search">
                                            <ul>
                                                <li>
                                                    <label>
                                                        公司名称
                                                    </label>
                                                    <asp:TextBox runat="server" ID="txt_companyName"></asp:TextBox>
                                                </li>
                                                <li style="width: auto; margin-right: 20px">
                                                    <label>
                                                        类别
                                                    </label>
                                                    <asp:DropDownList runat="server" ID="ddl_Type" DataTextField="name" DataValueField="xm">
                                                    </asp:DropDownList>
                                                </li>
                                                <li style="width: auto">
                                                    <label style="width: auto">
                                                        联系人手机
                                                    </label>
                                                    <asp:TextBox runat="server" ID="txt_mobile"></asp:TextBox>
                                                </li>
                                                <li>
                                                    <label>
                                                        &nbsp;
                                                    </label>
                                                    [<asp:LinkButton ID="lbtn_Search" runat="server" Text="搜 索" OnClick="lbtn_Search_Click" CausesValidation="false">
                                                    </asp:LinkButton>]&nbsp;&nbsp;&nbsp; [<a href="javascript:resetSrh();">重 置</a>]
                                                </li>
                                            </ul>
                                        </div>
                                    </Body>
                                </ext:Panel>
                            </ext:LayoutColumn>
                        </ext:ColumnLayout>
                    </Body>
                </ext:Panel>
            </Body>
        </ext:Panel>
        <p>
            &nbsp;</p>
        <div id="admin_list_content">
            <table cellpadding="0" cellspacing="0">
                <tr class="header-row">
                    <th>
                        类 别
                    </th>
                    <th>
                        编 号
                    </th>
                    <th>
                        名 称
                    </th>
                    <th>
                        联系人
                    </th>
                    <th>
                        摊位号
                    </th>
                    <th>
                        手机
                    </th>
                    <th>
                        得分
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                <asp:Repeater ID="rpt_list" runat="server">
                    <ItemTemplate>
                        <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                            <td>
                                <%# Eval("typeName")%>
                            </td>
                            <td>
                                <%# Eval("companyNo")%>
                            </td>
                            <td>
                                <%# Eval("company")%>
                            </td>
                            <td>
                                <%# Eval("contact")%>
                            </td>
                            <td>
                                <%# Eval("location")%>
                            </td>
                            <td>
                                <%# Eval("mobile")%>
                            </td>
                            <td>
                                <%# Eval("score") %>
                            </td>
                            <td align="left">
                                <a style="<%# Eval("type").ToString() == "1" ? "": "display:none;" %>" href="companySupplyRange.aspx?company=<%# Eval("companyId") %>">查看供应范围</a>
                                <span style="<%=power>=2?"":"display:none" %>">
                                <asp:LinkButton CausesValidation="false" runat="server" ID="link_CompanyCheck" OnCommand="link_CompanyCheck_Command" CommandArgument='<%#Eval("companyId") %>'>添加考核</asp:LinkButton>
                                </span>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <div id="page">
                <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                    OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="20"
                    InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                    ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                    CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                    LastPageText="末页" PrevPageText="上一页">
                </webdiyer:AspNetPager>
            </div>
        </div>
    </div>
    <ext:Window ID="windows1" runat="server" Title="企业考核" Height="255px" Width="600px"
        BodyStyle="padding: 6px; background-color: #fff;" AutoScroll="true" Modal="True"
        Resizable="false" ShowOnLoad="false" Draggable="false" Icon="ApplicationViewDetail">
        <Body>
            <table width="98%" align="center" cellpadding="5">
                <tr>
                    <td>
                        评分 *
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlOperate">
                            <asp:ListItem Value="0">减分</asp:ListItem>
                            <asp:ListItem Value="1">加分</asp:ListItem>
                        </asp:DropDownList>
                        <asp:TextBox size="5" MaxLength="5" runat="server" ID="txtScore"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtScore" ErrorMessage="请输入评分."></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ValidationExpression="^\+?[1-9][0-9]*$" ControlToValidate="txtScore" runat="server" ErrorMessage="评分格式输入不正确，请输入一个正整数."></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        原因 *
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtReason" TextMode="MultiLine" Columns="50" Rows="7"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </Body>
        <Buttons>
            <ext:Button OnClientClick="return OperateConfirm();" CausesValidation="true" runat="server" ID="btnSave" AutoPostBack="true" Icon="Accept" Text="保存" OnClick="btnSave_Click">
            </ext:Button>
        </Buttons>
    </ext:Window>
    <asp:HiddenField runat="server" ID="hdCurrentCompanyId" />
    </form>
</body>
</html>
